
    <?PHP include"../ini.php"; 
	     include"../../libraries/pager.php";
	     include"../../config.php"; 
	    include"../../libraries/xl_ho_tro_truc_tuyen.php";  
        

    $dt_ho_tro_truc_tuyen = new xl_ho_tro_truc_tuyen   ;
    $dt_Pager = new pager;
    

    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Hỗ trợ trực tuyến</title>
    <link rel="stylesheet" href="../skins/sa/resources/css/reset.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="../skins/sa/resources/css/style.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="../skins/sa/resources/css/invalid.css" type="text/css" media="screen" />	
    <script type="text/javascript" src="../skins/sa/resources/scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../skins/sa/resources/scripts/simpla.jquery.configuration.js"></script>
    <script type="text/javascript" src="../skins/sa/resources/scripts/facebox.js"></script>
    <script type="text/javascript" src="../skins/sa/resources/scripts/jquery.wysiwyg.js"></script>

    </head>
	    <body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
		    
		    <?php include '../widgets/sidebar.php'?> <!-- End #sidebar -->
		    
		    <div id="main-content"> <!-- Main Content Section with everything -->
			    
		    
			    <?php include '../widgets/noscript.php'?>
			    
			    
			    <div class="clear"></div> <!-- End .clear -->
          	<form id="form1" method="post" action="">
		     <table width="93%" height="72">
             <tr>
			    
                <td width="7%"> <label>Từ khóa tìm kiếm  <input type="text" name="tu_khoa"  /> </label></td>
                 <td width="31%"> <input class="button"  type="submit" name="btnTimKiem" value="Tìm kiếm" /></td>
                 </tr>
                 </table>
               
              </form>
              
    <div class="content-box"><!-- Start Content Box -->
			    
				    <div class="content-box-header">
					    
					    <h3>Hỗ trợ trực tuyến</h3>
					    
					    <ul class="content-box-tabs">
						    <li><a class="default-tab">Danh sách</a></li> <!-- href must be unique and match the id of target div -->
						    <li><a href="add.php">Thêm</a></li>
					    </ul>
					    
					    <div class="clear"></div>
					    
				    </div> <!-- End .content-box-header -->
				    
				    <div class="content-box-content">
					    
					    <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
						    
						    <table>
							    
							    <thead>
								    <tr>
								       <th><input class="check-all" type="checkbox" /></th>
								       <th>Mã</th>
								       <th>Tên</th>
								       <th>Loại</th>
								       <th>Nick name</th>
								       <th>Trạng thái</th>
                                       <th>Thao tác</th>
								    </tr>
								    
							    </thead>
						     
							    <tfoot>
								    <tr>
									    <td colspan="6">
										    <div class="bulk-actions align-left">
											    <select name="dropdown">
												    <option value="option1">Chọn thao tác...</option>
												    <option value="option2">Sửa</option>
												    <option value="option3">Xóa</option>
											    </select>
											    <a class="button" href="#">Áp dụng cho phần đã chọn</a>
										    </div>
										    
										    <div class="pagination">
										    <?php
                                            if(empty($_POST['tu_khoa']))
                                            
                                            {
										     $limit = 2;
									 		    # Tìm vị trí
											    $vitri = $dt_Pager->findStart($limit);
											    $tong_so_record =$dt_ho_tro_truc_tuyen->so_luong()
                                                ;
											    //echo $tong_so_record;
											    # Tìm tổng số trang
                                                $tong_so_trang = $dt_Pager->findPages($tong_so_record,$limit);
											    //echo $tong_so_trang;
											    # In bộ nút 
											    
											     echo $dt_Pager->pageList($_GET['page'],$tong_so_trang);
                                            }
										    ?>
										    </div> <!-- End .pagination -->
										    <div class="clear"></div>
									    </td>
								    </tr>
							    </tfoot>
						     
							    <tbody>
                                
                                <?php
               $_tukhoa=  $_POST['tu_khoa'];
                if(!empty($_tukhoa))
                {
      
                          $ds_ho_tro_truc_tuyen = $dt_ho_tro_truc_tuyen->tim_kiem($_tukhoa);
                    
                    if($ds_ho_tro_truc_tuyen!= null)
                    {
                        foreach($ds_ho_tro_truc_tuyen as $ho_tro_truc_tuyen )
                                    {
                                    
                                ?>
                                
                                    <tr>
                                        <td><input type="checkbox" /></td>
                                        <td><?php echo $ho_tro_truc_tuyen['ma']?></td>
                                        <td><a href="#" title="title"><?php echo $ho_tro_truc_tuyen['ho_ten']?></a></td>
                                        <td><img src="../../images/<?php echo $ho_tro_truc_tuyen['loai_ho_tro']?>.png"  /> </td>
                                        <td><?php echo $ho_tro_truc_tuyen['nick_chat']?></td>
                                        <td><?php echo $ho_tro_truc_tuyen['trang_thai']?>    </td>
                                        <td>
                                        <!-- Icons -->
                                             <a href="#" title="Edit"><img src="../skins/sa/resources/images/icons/pencil.png" alt="Edit" /></a>
                                             <a href="#" title="Delete"><img src="../skins/sa/resources/images/icons/cross.png" alt="Delete" /></a> 
                                             <a href="#" title="Edit Meta"><img src="../skins/sa/resources/images/icons/hammer_screwdriver.png" alt="Edit Meta" /></a>
                                        </td>
                                    </tr>
                                    
                                 <?php }  
                    }
              
                }
                else
                {
              ?>         
                                 <?php
							     
								    $ds_ho_tro_truc_tuyen = $dt_ho_tro_truc_tuyen->danh_sach($vitri,$limit);
								    //echo '<pre>';
								    //print_r($ds_ho_tro_truc_tuyen);
								    //echo '</pre>';
								    foreach($ds_ho_tro_truc_tuyen as $ho_tro_truc_tuyen )
								    {
								    
							    ?>
                                
								       <tr>
                                        <td><input type="checkbox" /></td>
                                        <td><?php echo $ho_tro_truc_tuyen['ma']?></td>
                                        <td><a href="#" title="title"><?php echo $ho_tro_truc_tuyen['ho_ten']?></a></td>
                                        <td><img src="../../images/<?php echo $ho_tro_truc_tuyen['loai_ho_tro']?>.png"  /> </td>
                                        <td><?php echo $ho_tro_truc_tuyen['nick_chat']?></td>
                                        <td><?php echo $ho_tro_truc_tuyen['trang_thai']?>    </td>
                                        <td>
                                        <!-- Icons -->
                                             <a href="#" title="Edit"><img src="../skins/sa/resources/images/icons/pencil.png" alt="Edit" /></a>
                                             <a href="#" title="Delete"><img src="../skins/sa/resources/images/icons/cross.png" alt="Delete" /></a> 
                                             <a href="#" title="Edit Meta"><img src="../skins/sa/resources/images/icons/hammer_screwdriver.png" alt="Edit Meta" /></a>
                                        </td>
                                    </tr>
								    
                                 <?php }  
                }?>
                                    
							    </tbody>
                                
                                <tr> 
							    
						    </table>
						    
					    </div> <!-- End #tab1 -->     
					    
				    </div> <!-- End .content-box-content -->
				    
    </div> <!-- End .content-box -->
						    
			    
			    <?php include '../widgets/footer.php'?><!-- End #footer -->
			    
		    </div> <!-- End #main-content -->
	    </div></body>
    </html>
